knitr::opts_knit$set(root.dir = '../../')

1 Overall Activation

source('scripts/my_r.R')
library(feather)
## Warning: package 'feather' was built under R version 3.3.2
library(ggplot2)
library(reshape2)
library(bsselectR)
info <- c('Type1', 'newseq.matchgc.E081', 'motif_activation')
pos <- load_and_melt('pattern/Type1/newseq.matchgc.E081/motif_activation/pattern_positive.feather')
neg <- load_and_melt('pattern/Type1/newseq.matchgc.E081/motif_activation/pattern_negative.feather')
ggplot(pos$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Positive)') + labs(x = 'motif', y = 'sequence')

ggplot(neg$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Negative)') + labs(x = 'motif', y = 'sequence')

2 Per Motif Activation

pvalues <- c()
motifs <- c()
for(i in colnames(pos$table)){
    if(i != 'id'){
        poss <- pos$table[[i]]
        negs <- neg$table[[i]]
        pvalues <- c(pvalues, wilcox.test(poss, negs)$p.value)
        motifs <- c(motifs, i)
    }
}
df <- data.frame(motif=motifs, p.value=pvalues)

2.1 Motif activation comparison (positive vs negative)

3 Show top 20 motifs

3.1 1 : Motif.156

1 : Motif.156

1 : Motif.156

3.2 2 : Motif.15

2 : Motif.15

2 : Motif.15

3.3 3 : Motif.66

3 : Motif.66

3 : Motif.66

3.4 4 : Motif.152

4 : Motif.152

4 : Motif.152

3.5 5 : Motif.125

5 : Motif.125

5 : Motif.125

3.6 6 : Motif.280

6 : Motif.280

6 : Motif.280

3.7 7 : Motif.4

7 : Motif.4

7 : Motif.4

3.8 8 : Motif.92

8 : Motif.92

8 : Motif.92

3.9 9 : Motif.209

9 : Motif.209

9 : Motif.209

3.10 10 : Motif.154

10 : Motif.154

10 : Motif.154

3.11 11 : Motif.85

11 : Motif.85

11 : Motif.85

3.12 12 : Motif.274

12 : Motif.274

12 : Motif.274

3.13 13 : Motif.99

13 : Motif.99

13 : Motif.99

3.14 14 : Motif.0

14 : Motif.0

14 : Motif.0

3.15 15 : Motif.82

15 : Motif.82

15 : Motif.82

3.16 16 : Motif.259

16 : Motif.259

16 : Motif.259

3.17 17 : Motif.143

17 : Motif.143

17 : Motif.143

3.18 18 : Motif.113

18 : Motif.113

18 : Motif.113

3.19 19 : Motif.173

19 : Motif.173

19 : Motif.173

3.20 20 : Motif.283

20 : Motif.283

20 : Motif.283